import React, { FC } from 'react'
import { Outlet } from 'react-router-dom'
import { Spin } from 'antd'
import useLoadUserData from '../hooks/useLoadUserData'
// Outlet 是应在父路由元素中使用<Outlet> 来呈现其子路由元素 呈现路由中的子元素

const QuestionLayout: FC = () => {
  const { waitingUserData } = useLoadUserData()
  return (<>
    {waitingUserData ? <div style={{ textAlign: 'center' }}><Spin /> </div> : <Outlet />}

  </>)
}

export default QuestionLayout